class CarStore(object):
    def __init__(self):
        self.factory = Factory()

    def order(self, car_type):
        return self.factory.select_car_by_type(car_type)


class Factory(object):
    def select_car_by_type(self, car_type):
        if car_type == "丰田":
            return Toyota()
        elif car_type == "本田":
            return Honda()
        elif car_type == "日产":
            return Nissan()


class Car(object):
    def move(self):
        print("车在移动")

    def music(self):
        print("正在播放音乐")

    def stop(self):
        print("车在停止")


class Toyota(Car):
    pass


class Honda(Car):
    pass


class Nissan(Car):
    pass


car_store = CarStore()
car = car_store.order("索纳塔")
car.move()
car.music()
car.stop()
